cargo.git
10 years agoAuto merge of #2355 - alexcrichton:fix-ordering-bug, r=brson
bors [Tue, 2 Feb 2016 21:12:37 +0000 (21:12 +0000)]
Auto merge of #2355 - alexcrichton:fix-ordering-bug, r=brson

Cargo needs to ensure that if a build script prints a `-L` path that it's the
first `-L` path passed to the compiler. That way the build script can be sure
that any output it generated is the first to be considered by the compiler.

Closes #2354

10 years agoFix DAG ordering of passed -L flags
Alex Crichton [Tue, 2 Feb 2016 19:42:57 +0000 (11:42 -0800)]
Fix DAG ordering of passed -L flags

Cargo needs to ensure that if a build script prints a `-L` path that it's the
first `-L` path passed to the compiler. That way the build script can be sure
that any output it generated is the first to be considered by the compiler.

Closes #2354

10 years agoAuto merge of #2353 - debris:bench_no_run, r=alexcrichton
bors [Tue, 2 Feb 2016 16:13:02 +0000 (16:13 +0000)]
Auto merge of #2353 - debris:bench_no_run, r=alexcrichton

Closes #2350

10 years agofixed cargo bench --no-run
debris [Tue, 2 Feb 2016 10:30:28 +0000 (11:30 +0100)]
fixed cargo bench --no-run

10 years agoAuto merge of #2351 - rbtcollins:master, r=alexcrichton
bors [Tue, 2 Feb 2016 06:12:10 +0000 (06:12 +0000)]
Auto merge of #2351 - rbtcollins:master, r=alexcrichton

10 years agoAuto merge of #2352 - alexcrichton:new-snapshots, r=alexcrichton
bors [Tue, 2 Feb 2016 04:52:21 +0000 (04:52 +0000)]
Auto merge of #2352 - alexcrichton:new-snapshots, r=alexcrichton

The current snapshot is *super* old (305 days), but as of a few minutes ago it looks like all builds are going to fail with:

```
    Updating registry `https://github.com/rust-lang/crates.io-index`
Failed to parse registry's information for: url

Caused by:
  the given version requirement is not implemented, yet
```

I believe this is because ages ago the semver library wasn't quite fully implemented. The [most recently published url crate](https://crates.io/crates/url/0.5.4) has a version requirement that looks like `>= foo, < bar` which I believe was implemented at some point in the last year.

As a result if we want to keep building Cargo on bors we'll have to upgrade the snapshot, so this does so! For now just pick the absolute newest Cargo to run with and we reset the counters!

10 years agoRegister new snapshots
Alex Crichton [Tue, 2 Feb 2016 04:49:06 +0000 (20:49 -0800)]
Register new snapshots

10 years agoFix warning about private types in API.
Robert Collins [Tue, 2 Feb 2016 04:37:06 +0000 (17:37 +1300)]
Fix warning about private types in API.

10 years agoAuto merge of #2348 - steveklabnik:gh2337, r=alexcrichton
bors [Mon, 1 Feb 2016 22:04:19 +0000 (22:04 +0000)]
Auto merge of #2348 - steveklabnik:gh2337, r=alexcrichton

Fixes #2337

10 years agoAdd a test for this too
Steve Klabnik [Mon, 1 Feb 2016 22:02:23 +0000 (17:02 -0500)]
Add a test for this too

10 years agoAuto merge of #2344 - Stebalien:upgrade-term, r=alexcrichton
bors [Mon, 1 Feb 2016 21:13:28 +0000 (21:13 +0000)]
Auto merge of #2344 - Stebalien:upgrade-term, r=alexcrichton

This PR re-upgrades term to 0.4.3. Cargo now detects whether or not
color is supported immediately after creating the TerminfoTerminal.

Backstory:

Before v0.4, term used to return `Ok(true)` if something succeeded,
`Ok(false)` if the operation was unsupported, and `Err(io::Error)` if there
was an IO error. Now, it returns `Ok(())` if the operation succeeds and
`Err(term::Error)` if the operation fails. If the operation is unsupported,
it returns `Err(term::Error::NotSupported)`. This means that, if `op` is
unsupported, `try!(term.op())` will now return an error instead of silently
failing (well, return false but that's effectively silent).

Fixes #2338.

10 years agoDon't fall back on stderr if color is unavailable
Steven Allen [Mon, 1 Feb 2016 14:48:52 +0000 (09:48 -0500)]
Don't fall back on stderr if color is unavailable

Having a TTY has no bearing on color support.

10 years agoDetect whether or not the terminal supports color.
Steven Allen [Mon, 1 Feb 2016 01:03:14 +0000 (20:03 -0500)]
Detect whether or not the terminal supports color.

Before v0.4, term used to return `Ok(true)` if something succeeded,
`Ok(false)` if the operation was unsupported, and `Err(io::Error)` if
there was an IO error. Now, it returns `Ok(())` if the operation
succeeds and `Err(term::Error)` if the operation fails. If the operation
is unsupported, it returns `Err(term::Error::NotSupported)`. This means
that, if `op` is unsupported, `try!(term.op())` will now return an error
instead of silently failing (well, return false but that's effectively
silent).

Fixes #2338

10 years agoBump semver version
Steve Klabnik [Mon, 1 Feb 2016 20:12:17 +0000 (15:12 -0500)]
Bump semver version

Fixes #2337

10 years agoAuto merge of #2336 - antonlarin:version-flag-interception-fix, r=alexcrichton
bors [Mon, 1 Feb 2016 19:22:12 +0000 (19:22 +0000)]
Auto merge of #2336 - antonlarin:version-flag-interception-fix, r=alexcrichton

Addresses #2286: when subcommand used `execute_main_without_stdin` and provided `--version` flag, cargo intercepted it and printed it's own version.

10 years agoAuto merge of #2347 - alexcrichton:robust-tests, r=wycats
bors [Mon, 1 Feb 2016 18:04:03 +0000 (18:04 +0000)]
Auto merge of #2347 - alexcrichton:robust-tests, r=wycats

* Remove the XDG_CONFIG_HOME environment variable as we're resetting HOME
* Add GIT_CONFIG_NOSYSTEM to encourage git to not read that configuration

Closes #2345

10 years agoMake tests a little more robust
Alex Crichton [Mon, 1 Feb 2016 18:02:04 +0000 (10:02 -0800)]
Make tests a little more robust

* Remove the XDG_CONFIG_HOME environment variable as we're resetting HOME
* Add GIT_CONFIG_NOSYSTEM to encourage git to not read that configuration

Closes #2345

10 years agoAdd a test for --version flag interception
Anton Larin [Sun, 31 Jan 2016 16:02:47 +0000 (19:02 +0300)]
Add a test for --version flag interception

10 years agoRevert "Downgrade term crate back down to 0.2 (from 0.4)."
Steven Allen [Sat, 30 Jan 2016 20:30:53 +0000 (15:30 -0500)]
Revert "Downgrade term crate back down to 0.2 (from 0.4)."

This reverts commit 75e0371ba0cd8ca235dea4e4178cf4c88dbf2e74.

10 years agoAuto merge of #2340 - gentoo90:bash-comp, r=alexcrichton
bors [Sat, 30 Jan 2016 19:58:02 +0000 (19:58 +0000)]
Auto merge of #2340 - gentoo90:bash-comp, r=alexcrichton

10 years agoBashcomp: complete init and metadata commands
gentoo90 [Sat, 30 Jan 2016 18:37:06 +0000 (20:37 +0200)]
Bashcomp: complete init and metadata commands

10 years agoAuto merge of #2339 - pnkfelix:downgrade-term-crate-for-emacs-shell, r=alexcrichton
bors [Sat, 30 Jan 2016 18:30:53 +0000 (18:30 +0000)]
Auto merge of #2339 - pnkfelix:downgrade-term-crate-for-emacs-shell, r=alexcrichton

Downgrade term crate back down to 0.2 (from 0.4).

This is undoing part of commit dd34296

Fix #2338

(Unfortunately I do not have a suggestion for how to make a unit test for this problem; doing so would require putting in a bit more effort than I have time for at the moment.)

10 years agoDowngrade term crate back down to 0.2 (from 0.4).
Felix S. Klock II [Sat, 30 Jan 2016 13:57:15 +0000 (14:57 +0100)]
Downgrade term crate back down to 0.2 (from 0.4).

This is undoing part of commit dd34296

Fix #2338

(Unfortunately I do not have a suggestion for how to make a unit test
for this problem; doing so would require putting in a bit more effort
than I have time for at the moment.)

10 years agoFix interception of subcommand --version flag
Anton Larin [Sat, 30 Jan 2016 09:47:25 +0000 (12:47 +0300)]
Fix interception of subcommand --version flag

Addresses #2286: when subcommand used execute_main_without_stdin and
provided --version flag, cargo intercepted it and printed it's own
version.

10 years agoAuto merge of #2333 - matklad:remove-unused-var, r=alexcrichton
bors [Sat, 30 Jan 2016 00:53:14 +0000 (00:53 +0000)]
Auto merge of #2333 - matklad:remove-unused-var, r=alexcrichton

It became unused after https://github.com/rust-lang/cargo/commit/3194a23a706c17037556c11e7bf4303ea233f208

Is this intentional that unused variables are not denied in tests?

10 years agotests: remove unused variable
Aleksey Kladov [Sat, 30 Jan 2016 00:45:45 +0000 (03:45 +0300)]
tests: remove unused variable

10 years agoAuto merge of #2331 - matklad:metadata-encodable-resolve, r=alexcrichton
bors [Fri, 29 Jan 2016 23:44:29 +0000 (23:44 +0000)]
Auto merge of #2331 - matklad:metadata-encodable-resolve, r=alexcrichton

10 years agometadata: change resolve serialization
Aleksey Kladov [Fri, 29 Jan 2016 20:47:16 +0000 (23:47 +0300)]
metadata: change resolve serialization

10 years agoAuto merge of #2330 - rillian:fixes, r=alexcrichton
bors [Fri, 29 Jan 2016 22:15:35 +0000 (22:15 +0000)]
Auto merge of #2330 - rillian:fixes, r=alexcrichton

std::slice::SliceConcatExt::connect() was deprecated in 1.3.0
and renamed to join(). Now that 1.6.0 is the stable release,
we can transition to the newer method name.

10 years agoReplace deprecated slice::connect with slice::join.
Ralph Giles [Fri, 29 Jan 2016 21:27:20 +0000 (13:27 -0800)]
Replace deprecated slice::connect with slice::join.

std::slice::SliceConcatExt::connect() was deprecated in 1.3.0
and renamed to join(). Now that 1.6.0 is the stable release,
we can transition to the newer method name.

10 years agoAuto merge of #2329 - alexcrichton:fix-nightly, r=alexcrichton
bors [Fri, 29 Jan 2016 18:40:28 +0000 (18:40 +0000)]
Auto merge of #2329 - alexcrichton:fix-nightly, r=alexcrichton

Relax an output assertion to just contains instead of exhaustively matching

10 years agoFix a test on nightly Rust
Alex Crichton [Fri, 29 Jan 2016 18:20:54 +0000 (10:20 -0800)]
Fix a test on nightly Rust

Relax an output assertion to just contains instead of exhaustively matching

10 years agoAuto merge of #2327 - alexcrichton:ustar-archives, r=alexcrichton
bors [Fri, 29 Jan 2016 04:10:44 +0000 (04:10 +0000)]
Auto merge of #2327 - alexcrichton:ustar-archives, r=alexcrichton

The tar::Builder type by default will build GNU archives, but
unfortunately we force it here to use UStar archives instead. The
UStar format has more limitations on the length of path name that it
can encode, so it's not quite as nice to use.

Older cargos, however, had a bug where GNU archives were interpreted
as UStar archives. This bug means that if we publish a GNU archive
which has fully filled out metadata it'll be corrupt when unpacked by
older cargos.

Hopefully in the future after enough cargos have been running around
with the bugfixed tar-rs library we'll be able to switch this over to
GNU archives, but for now we'll just say that you can't encode paths
in archives that are *too* long.

Closes #2326

10 years agoBuild UStar archives by default
Alex Crichton [Fri, 29 Jan 2016 04:07:56 +0000 (20:07 -0800)]
Build UStar archives by default

The tar::Builder type by default will build GNU archives, but
unfortunately we force it here to use UStar archives instead. The
UStar format has more limitations on the length of path name that it
can encode, so it's not quite as nice to use.

Older cargos, however, had a bug where GNU archives were interpreted
as UStar archives. This bug means that if we publish a GNU archive
which has fully filled out metadata it'll be corrupt when unpacked by
older cargos.

Hopefully in the future after enough cargos have been running around
with the bugfixed tar-rs library we'll be able to switch this over to
GNU archives, but for now we'll just say that you can't encode paths
in archives that are *too* long.

Closes #2326

10 years agoAuto merge of #2324 - rillian:fixes, r=alexcrichton
bors [Thu, 28 Jan 2016 22:05:50 +0000 (22:05 +0000)]
Auto merge of #2324 - rillian:fixes, r=alexcrichton

10 years agoFix a typo.
Ralph Giles [Thu, 28 Jan 2016 21:04:44 +0000 (13:04 -0800)]
Fix a typo.

10 years agoAuto merge of #2323 - alexcrichton:update-libgit2, r=alexcrichton
bors [Thu, 28 Jan 2016 16:51:20 +0000 (16:51 +0000)]
Auto merge of #2323 - alexcrichton:update-libgit2, r=alexcrichton

Fixes a linkage error on linux if libhttp_parser is already installed.

10 years agoUpdate libgit2-sys
Alex Crichton [Thu, 28 Jan 2016 16:50:31 +0000 (08:50 -0800)]
Update libgit2-sys

Fixes a linkage error on linux if libhttp_parser is already installed.

10 years agoAuto merge of #2321 - JanLikar:private-crate, r=alexcrichton
bors [Tue, 26 Jan 2016 17:53:26 +0000 (17:53 +0000)]
Auto merge of #2321 - JanLikar:private-crate, r=alexcrichton

I Accidentally closed #2218, this is the new PR.

[Fix #2202]

10 years ago Add field `publish` to Cargo.toml
Jan Likar [Sat, 23 Jan 2016 21:16:30 +0000 (22:16 +0100)]
 Add field `publish` to Cargo.toml

Field `publish` set to false can be used to prevent a
package from being accidentally published.

10 years agoAuto merge of #2319 - alexcrichton:compat-12, r=brson
bors [Mon, 25 Jan 2016 21:50:36 +0000 (21:50 +0000)]
Auto merge of #2319 - alexcrichton:compat-12, r=brson

There hasn't actually ever been a request to maintain compatibility with older
stable Rust versions, and it's becoming a bit of a maintenance burden, so just
switch CI to run on stable Rust.

10 years agoRemove 1.2.0 from .travis.yml
Alex Crichton [Mon, 25 Jan 2016 20:52:23 +0000 (12:52 -0800)]
Remove 1.2.0 from .travis.yml

There hasn't actually ever been a request to maintain compatibility with older
stable Rust versions, and it's becoming a bit of a maintenance burden, so just
switch CI to run on stable Rust.

10 years agoAuto merge of #2317 - alexcrichton:install-current-crate, r=alexcrichton
bors [Mon, 25 Jan 2016 19:06:18 +0000 (19:06 +0000)]
Auto merge of #2317 - alexcrichton:install-current-crate, r=alexcrichton

Rolling together https://github.com/rust-lang/cargo/pull/2205 and  https://github.com/rust-lang/cargo/pull/2240

10 years agoAuto merge of #2316 - alexcrichton:update, r=alexcrichton
bors [Mon, 25 Jan 2016 18:53:17 +0000 (18:53 +0000)]
Auto merge of #2316 - alexcrichton:update, r=alexcrichton

A few small tweaks to tests were necessary to accomodate rust-lang/rust#29520,
and a few changes were made to the code to account for that as well.

10 years agoUpgrade Rust to build Cargo
Alex Crichton [Mon, 25 Jan 2016 18:20:23 +0000 (10:20 -0800)]
Upgrade Rust to build Cargo

A few small tweaks to tests were necessary to accomodate rust-lang/rust#29520,
and a few changes were made to the code to account for that as well.

10 years agoBe sure the 'is not a crate root' message shows up
Alex Crichton [Mon, 25 Jan 2016 18:41:44 +0000 (10:41 -0800)]
Be sure the 'is not a crate root' message shows up

10 years agoMerge branch 'master' of https://github.com/JIghtuse/cargo into install-current-crate
Alex Crichton [Mon, 25 Jan 2016 18:26:47 +0000 (10:26 -0800)]
Merge branch 'master' of https://github.com/JIghtuse/cargo into install-current-crate

10 years agoMerge branch 'quick-install' of https://github.com/thirtythreeforty/cargo into instal...
Alex Crichton [Mon, 25 Jan 2016 18:26:34 +0000 (10:26 -0800)]
Merge branch 'quick-install' of https://github.com/thirtythreeforty/cargo into install-current-crate

10 years agoAuto merge of #2196 - matklad:metadata2, r=alexcrichton
bors [Mon, 25 Jan 2016 17:56:00 +0000 (17:56 +0000)]
Auto merge of #2196 - matklad:metadata2, r=alexcrichton

Most of the work was done by @dan-t in #1225 and by @winger in #1434

Fixes #2193

I failed to properly rebase previous attempts so I just salvaged this from bits and pieces.

@alexcrichton are you sure that the default format should be TOML? I think that TOML is more suitable for humans, and JSON is better (at the moment at least) for tools. Maybe we should default to ~~TOML~~ JSON?

10 years agoAuto merge of #2297 - alexcrichton:update, r=alexcrichton
bors [Mon, 25 Jan 2016 17:34:19 +0000 (17:34 +0000)]
Auto merge of #2297 - alexcrichton:update, r=alexcrichton

Just a routine for niche bug fixes, linkage errors, perf improvements, etc.

Closes #2295

10 years agoUpdate dependencies and Rust version
Alex Crichton [Wed, 20 Jan 2016 17:07:47 +0000 (09:07 -0800)]
Update dependencies and Rust version

Just a routine for niche bug fixes, linkage errors, perf improvements, etc.

10 years agometadata: use existing infra for JSON output
Aleksey Kladov [Sun, 24 Jan 2016 21:16:33 +0000 (00:16 +0300)]
metadata: use existing infra for JSON output

10 years agometadata: add version to format
Aleksey Kladov [Sat, 23 Jan 2016 11:54:35 +0000 (14:54 +0300)]
metadata: add version to format

10 years agometadata: simplify
Aleksey Kladov [Thu, 14 Jan 2016 23:47:58 +0000 (02:47 +0300)]
metadata: simplify

10 years agometadata: serialize Resolve
Aleksey Kladov [Mon, 21 Dec 2015 15:05:26 +0000 (18:05 +0300)]
metadata: serialize Resolve

10 years agoIntroduce cargo metadata subcommand
Aleksey Kladov [Sat, 5 Dec 2015 00:22:54 +0000 (03:22 +0300)]
Introduce cargo metadata subcommand

Most of the work was done by @dan-t in #1225 and by @winger in #1434

Fixes #2193

10 years agoAuto merge of #2081 - vi:cargo_init, r=alexcrichton
bors [Sun, 24 Jan 2016 18:42:32 +0000 (18:42 +0000)]
Auto merge of #2081 - vi:cargo_init, r=alexcrichton

Implement `cargo init` command and appropriate tests ( #21).

Features:
* Working like `cargo new` if there are no files in current directory
* Auto-detection of `--bin`
* Auto-detection of already existing VSC and appending to respecive ignore file
* Appending of appropriate `[lib]` or `[[bin]]` section to `Cargo.toml` in case of some non-standard source locations

Concerns:
* I'm not experienced in Rust + lazy => code looks poorer compared to the rest Cargo code
* The test don't cover 100% of functions
* Project consisting of both binary and library is not handled
* Many deviations from [previously proposed algorithm](https://github.com/rust-lang/cargo/pull/2008#issuecomment-145607870)

10 years agoImplement "cargo init"
Vitaly _Vi Shukela [Sat, 23 Jan 2016 12:48:59 +0000 (15:48 +0300)]
Implement "cargo init"

When non-existing directory is provided as argument, it
works just like "cargo new".

When existing directory is used, it may also create template
source file like "cargo new" or may find and use existing
source code for Cargo.toml.

Squashed commit of the following:

    cargo init: Supply USER envvar for one test
    cargo init: Other message when Cargo.toml already exists
    cargo init: Resolve conflict after with #2257
    fix minor issues
    cargo new/init: Simplify error handling code in entry points
    cargo new/init: Better message for invalid characters in name
    cargo init: fix minor issues in test
    cargo init: Avoid excessive builds in the test
    cargo init: minor fixes
    cargo init: Skip no_filename test on Windows
    cargo init: Implement better error message for bin name clash
    cargo init: minor fixes
    cargo init: handle "/" path
    cargo init: Actualise
    cargo new: Fix upper case error message in test
    cargo init: Remove paths::{file,directory}_already_exists
    fix uppper-case error messages
    cargo init: Fix minor issues per diff comments
    cargo init: Change binary handling
    cargo init: Move multiple lib error detection away from mk
    cargo init: Support optional path argument
    cargo init: Fix minor issues per Github comments
    cargo init: Fix complaint from tests/check-style.sh
    cargo init: Handle projects with multiple mains
    cargo init: Major refactor, multi-target projects
    cargo init: Add Cargo.lock unconditionally
    cargo init: Fix complains from tests/check-style.sh
    cargo init: Tests for handling VCS
    cargo init: Handle VCS
    cargo init: work in progress
    cargo init: Deduplicate some things between new and init
    cargo init: Auto-detection of --bin
    cargo init: work in progress...
    cargo init: Fix tests and allow explicit --vcs
    cargo init: intermediate refactor
    cargo init: First sketch of implementation
    cargo init: Preliminary test
    cargo init: first stub

See
https://github.com/vi/cargo/tree/cargo_init_unsquashed
for individual commits

10 years agoAuto merge of #2307 - alexcrichton:readme, r=brson
bors [Sat, 23 Jan 2016 00:21:03 +0000 (00:21 +0000)]
Auto merge of #2307 - alexcrichton:readme, r=brson

Running `cargo build` should work just fine to build cargo as well as not
running the python script to download rustc itself. Now that Cargo runs on
stable (and a pretty old stable) most Rust installations should "Just Work" to
build Cargo.

10 years agoAdd more info to README about compiling
Alex Crichton [Sat, 23 Jan 2016 00:09:17 +0000 (16:09 -0800)]
Add more info to README about compiling

Running `cargo build` should work just fine to build cargo as well as not
running the python script to download rustc itself. Now that Cargo runs on
stable (and a pretty old stable) most Rust installations should "Just Work" to
build Cargo.

10 years agoMerge pull request #2303 from alexcrichton/bump
Brian Anderson [Thu, 21 Jan 2016 21:50:01 +0000 (13:50 -0800)]
Merge pull request #2303 from alexcrichton/bump

Bump to 0.9.0

10 years agoBump to 0.9.0
Alex Crichton [Thu, 21 Jan 2016 21:47:11 +0000 (13:47 -0800)]
Bump to 0.9.0

10 years agoAuto merge of #2299 - retep998:staticlib-naming-fiasco, r=alexcrichton
bors [Thu, 21 Jan 2016 00:24:30 +0000 (00:24 +0000)]
Auto merge of #2299 - retep998:staticlib-naming-fiasco, r=alexcrichton

Required for https://github.com/rust-lang/rust/pull/29520

r? @alexcrichton

10 years agoSupport static libraries with names other than libfoo.a
Peter Atashian [Wed, 20 Jan 2016 20:59:11 +0000 (15:59 -0500)]
Support static libraries with names other than libfoo.a
Required for https://github.com/rust-lang/rust/pull/29520

Signed-off-by: Peter Atashian <retep998@gmail.com>
10 years agoAuto merge of #2296 - alexcrichton:wow-thats-a-bad-bug, r=brson
bors [Wed, 20 Jan 2016 19:41:06 +0000 (19:41 +0000)]
Auto merge of #2296 - alexcrichton:wow-thats-a-bad-bug, r=brson

There was a previous bug where if any crate's name was the start of the crate
being updated that the crate wouldn't resolve at all, and this fixes the prefix
checking error bug.

cc #2293

10 years agoAuto merge of #2270 - felixc:warn-on-empty-dep, r=alexcrichton
bors [Wed, 20 Jan 2016 17:36:59 +0000 (17:36 +0000)]
Auto merge of #2270 - felixc:warn-on-empty-dep, r=alexcrichton

This warns when encountering dependencies of either of these forms:
```
  [dependencies]
  foo = {}
```
and
```
  [dependencies.foo]
```
(with nothing further provided).

In the future, this should likely become a hard error.

Related to #2147

10 years agoEmit a warning when manifest specifies empty dependency constraints
Felix Crux [Mon, 11 Jan 2016 16:08:20 +0000 (11:08 -0500)]
Emit a warning when manifest specifies empty dependency constraints

This warns when encountering dependencies of either of these forms:

  [dependencies]
  foo = {}

and

  [dependencies.foo]

(with nothing further provided).

In the future, this should likely become a hard error.

10 years agoAuto merge of #2282 - mcarton:clippy, r=alexcrichton
bors [Tue, 19 Jan 2016 23:05:06 +0000 (23:05 +0000)]
Auto merge of #2282 - mcarton:clippy, r=alexcrichton

For information, here is the [log before and after](https://gist.github.com/mcarton/684c030321c4c60d6bc9) with Clippy.
Remaining warnings from Clippy are mostly false positive or `str` to `string` conversion (too many of them for this PR).

```
warnings before:
     cmp_owned : 2
     cyclomatic_complexity : 1
     deprecated : 11
     explicit_iter_loop : 57
     identity_op : 3
     len_without_is_empty : 3
     len_zero : 20
     let_and_return : 3
     map_clone : 14
     needless_lifetimes : 4
     needless_return : 24
     ok_expect : 2
     option_map_unwrap_or : 10
     private_in_public : 28
     redundant_closure : 2
     should_implement_trait : 2
     single_match : 3
     str_to_string : 112
     string_to_string : 12
     type_complexity : 3
     unnecessary_mut_passed : 2
     unneeded_field_pattern : 3
     unused_lifetimes : 1
     unused_variables : 2
     while_let_loop : 2

warnings after:
     cmp_owned : 2
     cyclomatic_complexity : 1
     identity_op : 1
     let_and_return : 3
     map_clone : 1
     needless_return : 3
     ok_expect : 2
     option_map_unwrap_or : 1
     private_in_public : 28
     should_implement_trait : 2
     str_to_string : 80
     type_complexity : 3
     while_let_loop : 2
```

10 years agoFix update --precise with the registry source
Alex Crichton [Tue, 19 Jan 2016 20:06:58 +0000 (12:06 -0800)]
Fix update --precise with the registry source

There was a previous bug where if any crate's name was the start of the crate
being updated that the crate wouldn't resolve at all, and this fixes the prefix
checking error bug.

cc #2293

10 years agoAuto merge of #2285 - sfackler:revert-wildcard-warning, r=alexcrichton
bors [Sun, 17 Jan 2016 01:33:10 +0000 (01:33 +0000)]
Auto merge of #2285 - sfackler:revert-wildcard-warning, r=alexcrichton

The crates.io change is going through, so we don't want this warning
around after it lands.

r? @alexcrichton

This would perferrably make it into the Cargo that's shipping with 1.6.

10 years agoAuto merge of #2287 - alexcrichton:openbsd, r=alexcrichton
bors [Sun, 17 Jan 2016 00:56:58 +0000 (00:56 +0000)]
Auto merge of #2287 - alexcrichton:openbsd, r=alexcrichton

cc @semarie

10 years agoRegister an OpenBSD snapshot
Alex Crichton [Sun, 17 Jan 2016 00:56:31 +0000 (16:56 -0800)]
Register an OpenBSD snapshot

10 years agoDrop wildcard crates.io warning
Steven Fackler [Sat, 16 Jan 2016 22:30:09 +0000 (14:30 -0800)]
Drop wildcard crates.io warning

The crates.io change is going through, so we don't want this warning
around after it lands.

10 years agoUse .cloned() where appropriate
mcarton [Fri, 15 Jan 2016 16:50:46 +0000 (17:50 +0100)]
Use .cloned() where appropriate

Fix most of Clippy’s map_clone warnings.

10 years agoRemove some useless String::to_string calls
mcarton [Fri, 15 Jan 2016 16:35:22 +0000 (17:35 +0100)]
Remove some useless String::to_string calls

Fix some Clippy’s string_to_string warnings.

10 years agoRemove unnecessary mut
mcarton [Fri, 15 Jan 2016 15:36:09 +0000 (16:36 +0100)]
Remove unnecessary mut

Fix all of Clippy’s unnecessary_mut_passed warnings.

10 years agoReplace single matches by ifs
mcarton [Fri, 15 Jan 2016 15:01:31 +0000 (16:01 +0100)]
Replace single matches by ifs

Fix all Clippy’s single_match warnings.

10 years agoRemove redundant closure
mcarton [Fri, 15 Jan 2016 14:51:27 +0000 (15:51 +0100)]
Remove redundant closure

Fix all Clippy’s redundant_closure warnings.

10 years agoUse .is_empty() where appropriate
mcarton [Fri, 15 Jan 2016 14:51:28 +0000 (15:51 +0100)]
Use .is_empty() where appropriate

Fix all of Clippy’s len_zero warnings.

10 years agoAdd an is_empty method to types with a len one
mcarton [Fri, 15 Jan 2016 14:51:26 +0000 (15:51 +0100)]
Add an is_empty method to types with a len one

Fix all Clippy’s len_without_is_empty warnings.

10 years agoRemove useless returns
mcarton [Fri, 15 Jan 2016 14:51:25 +0000 (15:51 +0100)]
Remove useless returns

Fix most of Clippy’s needless_return warnings. Remaining cases are
false positives.

10 years agoRemove useless lifetimes
mcarton [Fri, 15 Jan 2016 14:51:23 +0000 (15:51 +0100)]
Remove useless lifetimes

Fix all Clippy’s needless_lifetimes warnings.

10 years agoAuto merge of #2281 - rillian:doc-nocapture, r=alexcrichton
bors [Fri, 15 Jan 2016 21:36:03 +0000 (21:36 +0000)]
Auto merge of #2281 - rillian:doc-nocapture, r=alexcrichton

Although this is a feature of rustc's test harness and
not cargo's test driver, I can never remember how to
invoke it. Describing the switch in `cargo test --help`
makes it more discoverable.

10 years agoDocument --nocapture to reduce confusion running tests.
Ralph Giles [Fri, 15 Jan 2016 16:59:55 +0000 (08:59 -0800)]
Document --nocapture to reduce confusion running tests.

Although this is a feature of rustc's test harness and
not cargo's test driver, I can never remember how to
invoke it. Describing the switch in `cargo test --help`
makes it more discoverable.

10 years agoAuto merge of #2279 - alexcrichton:rerun-if-changed-rust-file, r=brson
bors [Fri, 15 Jan 2016 00:40:34 +0000 (00:40 +0000)]
Auto merge of #2279 - alexcrichton:rerun-if-changed-rust-file, r=brson

There was a failure mode of the handling of the rerun-if-changed directive where
it would rerun the build script twice before hitting a steady state of actually
processing the directives. The order of events that led to this were:

1. A project was built from a clean directory. Cargo recorded a fingerprint
   indicating this (for the build script), but the fingerprint indicated that
   the build script was a normal build script (no manually specified inputs)
   because Cargo had no prior knowledge.
2. A project was then rebuilt from the same directory. Cargo's new fingerprint
   for the build script now indicates that there is a custom list of
   dependencies, but the previous fingerprint indicates there wasn't, so the
   mismatch causes another rebuild.
3. All future rebuilds will agree that there are custom lists both before and
   after, so the directives are processed as one would expect.

This commit does a bit of refactoring in the fingerprint module to fix this
situation. The recorded fingerprint in step (1) is now recorded as a "custom
dependencies are specified" fingerprint if, after the build script is run,
custom dependencies were specified.

Closes #2267

10 years agoHandle rerun-if-changed directives in dependencies
Alex Crichton [Wed, 13 Jan 2016 01:37:57 +0000 (17:37 -0800)]
Handle rerun-if-changed directives in dependencies

There was a failure mode of the handling of the rerun-if-changed directive where
it would rerun the build script twice before hitting a steady state of actually
processing the directives. The order of events that led to this were:

1. A project was built from a clean directory. Cargo recorded a fingerprint
   indicating this (for the build script), but the fingerprint indicated that
   the build script was a normal build script (no manually specified inputs)
   because Cargo had no prior knowledge.
2. A project was then rebuilt from the same directory. Cargo's new fingerprint
   for the build script now indicates that there is a custom list of
   dependencies, but the previous fingerprint indicates there wasn't, so the
   mismatch causes another rebuild.
3. All future rebuilds will agree that there are custom lists both before and
   after, so the directives are processed as one would expect.

This commit does a bit of refactoring in the fingerprint module to fix this
situation. The recorded fingerprint in step (1) is now recorded as a "custom
dependencies are specified" fingerprint if, after the build script is run,
custom dependencies were specified.

Closes #2267

10 years agoAuto merge of #2276 - alexcrichton:fix-nightly, r=alexcrichton
bors [Tue, 12 Jan 2016 18:48:03 +0000 (18:48 +0000)]
Auto merge of #2276 - alexcrichton:fix-nightly, r=alexcrichton

Just some tweaks to compiler error messages

10 years agoAuto merge of #2228 - tbu-:pr_only_missing, r=alexcrichton
bors [Tue, 12 Jan 2016 17:50:34 +0000 (17:50 +0000)]
Auto merge of #2228 - tbu-:pr_only_missing, r=alexcrichton

10 years agoFix tests on nightly
Alex Crichton [Tue, 12 Jan 2016 17:47:31 +0000 (09:47 -0800)]
Fix tests on nightly

10 years agoAuto merge of #2269 - felixc:package-untracked-files, r=alexcrichton
bors [Tue, 12 Jan 2016 17:18:05 +0000 (17:18 +0000)]
Auto merge of #2269 - felixc:package-untracked-files, r=alexcrichton

The logic in `sources/path.rs` that finds files that are untracked by the version control system was incorrectly including files that *are* tracked, but had been modified without the modification being committed to Git.

This manifested itself as strange duplications of files (e.g. in `cargo package --list`), since they were listed once as tracked files, and once more as allegedly "untracked" ones. It also caused failures when trying to package the crate when files had been deleted, but the deletion was not yet committed to Git.

Fixes #2199

10 years agoFix listing of untracked files to not include tracked but modified ones
Felix Crux [Sun, 10 Jan 2016 19:47:02 +0000 (14:47 -0500)]
Fix listing of untracked files to not include tracked but modified ones

The logic in `sources/path.rs` that finds files that are untracked by the
version control system was incorrectly including files that *are* tracked,
but had been modified without the modification being committed to Git.

This manifested itself as strange duplications of files (e.g. in `cargo
package --list`), since they were listed once as tracked files, and once
more as allegedly "untracked" ones. It also caused failures when trying to
package the crate when files had been deleted, but the deletion was not
yet committed to Git.

Fixes #2199

10 years agoBump rand to 0.3.13
Felix Crux [Tue, 12 Jan 2016 00:00:05 +0000 (19:00 -0500)]
Bump rand to 0.3.13

10 years agoAuto merge of #2265 - dirk:dirk/include-publish-command-in-help, r=alexcrichton
bors [Mon, 11 Jan 2016 22:44:56 +0000 (22:44 +0000)]
Auto merge of #2265 - dirk:dirk/include-publish-command-in-help, r=alexcrichton

This is pretty commonly-used command, so I think it merits inclusion in the help text.

10 years agoAuto merge of #2257 - nrc:lib-template, r=alexcrichton
bors [Mon, 11 Jan 2016 18:15:34 +0000 (18:15 +0000)]
Auto merge of #2257 - nrc:lib-template, r=alexcrichton

10 years agoOnly treat missing crate lists as empty
Tobias Bucher [Fri, 18 Dec 2015 12:27:08 +0000 (12:27 +0000)]
Only treat missing crate lists as empty

The motivation is that errors other than "file not found" could lead to
the file being overwritten by an empty config, e.g. if the `open` call
is interrupted and returns `EINTR`, then this code would read an empty
config and write it back later on. This can probably happen for other
errors as well (`ENFILE`, ...).

10 years agoAdd publish command to list of commands in help text
Dirk Gadsden [Fri, 8 Jan 2016 22:40:02 +0000 (14:40 -0800)]
Add publish command to list of commands in help text

10 years agoMerge pull request #2260 from durka/patch-4
Brian Anderson [Wed, 6 Jan 2016 18:40:33 +0000 (10:40 -0800)]
Merge pull request #2260 from durka/patch-4

doc/manifest: add `cargo run --example`

10 years agoMerge pull request #2243 from felixc/zsh-completion-options
Brian Anderson [Wed, 6 Jan 2016 18:37:54 +0000 (10:37 -0800)]
Merge pull request #2243 from felixc/zsh-completion-options

Complete the definition of all options for zsh auto-completion

10 years agodoc/manifest: add `cargo run --example`
Alex Burka [Sun, 3 Jan 2016 02:04:17 +0000 (21:04 -0500)]
doc/manifest: add `cargo run --example`

Closes #2251. Should it be mentioned anywhere else as well?

10 years agoTweak the new project template to be more idiomatic.
Nick Cameron [Thu, 31 Dec 2015 03:12:56 +0000 (16:12 +1300)]
Tweak the new project template to be more idiomatic.